package com.oc.utils;

import net.rim.device.api.system.Display;
import net.rim.device.api.ui.Color;
import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.FontFamily;
import net.rim.device.api.ui.Ui;
import net.rim.device.api.ui.XYEdges;
import net.rim.device.api.ui.component.EditField;
import net.rim.device.api.ui.decor.Border;
import net.rim.device.api.ui.decor.BorderFactory;

public class Style {

	private static Font fh1 = null;
	private static Font fh2 = null;
	private static Font fh3 = null;
	private static Font fnormal = null;
	
	public static Font h1(){
		if(fh1 == null){
			fh1 = Font.getDefault();
			fh1.derive(Font.BOLD,14,Ui.UNITS_px);
		}
		return fh1;
	}
	
	public static Font h2(){
		if(fh2 == null){
			fh2 = Font.getDefault();
			fh2.derive(Font.BOLD,12,Ui.UNITS_px);
		}
		return fh2;
	}

	public static Font h3(){
		if(fh3 == null){
			fh3 = Font.getDefault();
		}
		return fh3;
	}
	
	public static Font normal(){
		if(fnormal == null){
			fnormal = Font.getDefault();
			fnormal.derive(Font.BOLD,14,Ui.UNITS_px);
		}
		return fnormal;
	}
	
	
	public static Border fieldBorder(){
		XYEdges edges =  new XYEdges(7,7,7,7);
		return BorderFactory.createRoundedBorder(edges,Color.DARKGRAY, Border.STYLE_SOLID);
	}

	public static Border errorFieldBorder(){
		XYEdges edges =  new XYEdges(7,7,7,7);
		return BorderFactory.createRoundedBorder(edges, Color.RED ,Border.STYLE_SOLID);
	}

	
	private static int _width = 0;
	public static int getScreenWidht(){
		if(_width == 0){
			_width = Display.getWidth();
			
			if(_width < 100){
				_width = 360;
			}
		}
		
		return _width;
		
	}
	
	
}
